package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import jtk.project4.fleet.domain.PmHist;
import jtk.project4.fleet.domain.Receipts;

public class PmHistDao extends IbatisDao{
	public List selectPmHists() throws SQLException {
		List selectPmHist = null;
			selectPmHist =getSqlMap().queryForList("SELECT_ALL_PMHIST", null);
		return selectPmHist;
	}
	
	public int deletePmHist(PmHist pmHist) throws SQLException{
		return (int) getSqlMap().delete("DELETE_PMHIST", pmHist);
	}
	
	public int updatePmHist(PmHist pmHist) throws SQLException{
		return (int) getSqlMap().update("UPDATE_PMHIST", pmHist);
	}
	
	public Receipts insertPmHist(PmHist pmHist) throws SQLException{
		return (Receipts) getSqlMap().insert("INSERT_PMHIST", pmHist);
	}
	
	
	
	public static void main(String[] args) throws SQLException{
		//deklarasi objek dan list objek
		PmHist x = new PmHist() ;
		x.setPCost("3");
		x.setLCost("2");
		new PmHistDao().insertPmHist(x);
	}	
}